/**
 * Licensee: Universidad de La Frontera
 * License Type: Academic
 */
package ormsamples;

import org.orm.*;
public class CreateTallerdeSOAData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.tallerdesoa.TallerdeSOAPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.tallerdesoa.DAOFactory lDAOFactory = orm.tallerdesoa.DAOFactory.getDAOFactory();
			orm.tallerdesoa.dao.Tcp_personaDAO lormtallerdesoaTcp_personaDAO = lDAOFactory.getTcp_personaDAO();
			orm.tallerdesoa.Tcp_persona lormtallerdesoaTcp_persona = lormtallerdesoaTcp_personaDAO.createTcp_persona();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tcp_publicacion, pers_sexo, pers_nombre, pers_dverificador, pers_rut
			lormtallerdesoaTcp_personaDAO.save(lormtallerdesoaTcp_persona);
			orm.tallerdesoa.dao.Tcp_publicacionDAO lormtallerdesoaTcp_publicacionDAO = lDAOFactory.getTcp_publicacionDAO();
			orm.tallerdesoa.Tcp_publicacion lormtallerdesoaTcp_publicacion = lormtallerdesoaTcp_publicacionDAO.createTcp_publicacion();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tcp_personaPers, pub_monto
			lormtallerdesoaTcp_publicacionDAO.save(lormtallerdesoaTcp_publicacion);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateTallerdeSOAData createTallerdeSOAData = new CreateTallerdeSOAData();
			try {
				createTallerdeSOAData.createTestData();
			}
			finally {
				orm.tallerdesoa.TallerdeSOAPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
